$.get('../data/goods.json','json')
.then(data=>{
    var res1 = data.slice(0,4)
    var res2 = data.slice(5,9)
    var res3 = data.slice(10,14)
    var res4 = data.slice(15,19)
    var res5 = data.slice(20,21)
    var res6 = data.slice(22,25)
    var res7 = data.slice(26,29)
    var res8 = data.slice(30,34)
    var res9 = data.slice(35,39)
    var res10 = data.slice(40,44)
    var res11 = data.slice(45,49)
    // var res12 = data.slice(100,108)
    res1.forEach(item=>{
        $('.xuan1')[0].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res2.forEach(item=>{
        $('.xuan1')[1].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res3.forEach(item=>{
        $('.xuan1')[2].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res4.forEach(item=>{
        $('.xuan1')[3].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res5.forEach(item=>{
        $('.xuan2')[0].innerHTML += `
            <div class="big-pro">
                <div class="hd">
                    <a href="http://localhost:8888/html/details.html?id=${item.goods_id}">
                        <img src="${item.img_small_logo}" alt="">
                    </a>
                </div>
                <div class="bd">
                    <h4 class="name">${item.title}</h4>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res6.forEach(item=>{
        $('.xuan2')[0].innerHTML += `
        <div class="sma-pro">
            <div class="hd">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}">
                    <img src="${item.img_small_logo}" alt="">
                </a>
            </div>
            <div class="bd">
                <h4 class="name">${item.title}</h4>
                <p class="price">￥${item.current_price}</p>
            </div>
        </div>
        `
    })
    res7.forEach(item=>{
        $('.xuan2')[0].innerHTML += `
        <div class="sma-pro sma-pro1">
            <div class="hd">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}">
                    <img src="${item.img_small_logo}" alt="">
                </a>
            </div>
            <div class="bd">
                <h4 class="name">${item.title}</h4>
                <p class="price">￥${item.current_price}</p>
            </div>
        </div>
        `
    })
    res8.forEach(item=>{
        $('.xuan3')[0].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })   
    res9.forEach(item=>{
        $('.xuan3')[1].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res10.forEach(item=>{
        $('.xuan3')[2].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
    res11.forEach(item=>{
        $('.xuan3')[3].innerHTML += `
            <div class="pc1">
                <a href="http://localhost:8888/html/details.html?id=${item.goods_id}" class="aa">
                    <img src="${item.img_small_logo}" alt="">
                </a>
                <div class="bd">
                    <a href="" class="ab">
                        <h4>${item.title}</h4>
                    </a>
                    <p class="price">￥${item.current_price}</p>
                </div>
            </div>
        `
    })
})